// import requests from "@/utils/requests";

export const getDeviceSign = () => {
  const userAgent = navigator.userAgent;
  // requests.get("").then((res) => {
  //   console.log(res.data);
  // });
  const Agents = [
    { m: ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"] },
  ];
  for (let index1 in Agents) {
    for (let index2 in Agents[index1].value) {
      if (userAgent == Agents[index1].value[index2]) {
        return Agents[index1].key;
      }
    }
  }
  const width =
    document.documentElement.clientWidth || document.body.clientWidth;
  if (width < 840) {
    //小于840px的屏幕，判定为手机
    return "m";
  }
  // return "pc";
  return "m";
};
